package com.example.controller;

import com.example.utils.BadRequestException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "test-controller", description = "test-controller")
public class MyController {

    @ApiOperation(value = "test", notes = "test")
    @GetMapping("/test")
    public String test(int number) {
        try {
            int index = 1 / number;
        } catch (Exception ex) {
            throw new BadRequestException("MyController", "MMP");
        }
        return "ok";
    }
}
